import { useQuery } from "@tanstack/react-query";
import { request } from "../api/request";
import { SCORE_URL } from "../constants/url";

const scoreFn = async () => {
  const { data } = await request(
    {
      url: SCORE_URL,
      method: "get",
    },
    true
  );
  return {
    data,
  };
};

export default function useScore() {
  return useQuery(["score"], scoreFn);
}
